//公告
import { get_notice, del_notice } from "@/api/notice";
export default {
  namespaced: true,
  state: {
    rows: [],
    info: {},
  },
  mutations: {
    toggle: (state, payload) => {
      state.rows = payload.resultObj;
      console.log(state.rows, "togglex");
    },
    modify: (state, payload) => {
      state.info = payload;
      console.log(state.info, "payload");
    },
  },
  actions: {
    getNoticeList: async ({ commit }) => {
      const data = await get_notice();
      commit("toggle", data);
    },
    removeNotice: async ({ state }) => {
      const { info } = state;
      const { success } = await del_notice(info);
      return success;
    },
  },
  getters: {},
};
